package org.aplikator.appUtils;

import org.aplikator.client.shared.rpc.AplikatorService;
import org.jboss.errai.jaxrs.ErraiProvider;
import org.jboss.resteasy.client.jaxrs.ResteasyWebTarget;

import javax.ws.rs.client.Client;
import javax.ws.rs.client.ClientBuilder;
import javax.ws.rs.client.WebTarget;

public class ExampleErraiClient {

	public static final String URL = "http://127.0.0.1:8888";
	
	public static void main(String[] args) {
		
		Client client = ClientBuilder.newClient();
		WebTarget target = client.target(URL);
		ResteasyWebTarget rtarget 
		= (ResteasyWebTarget) target;
		
		rtarget.register(ErraiProvider.class);
		
		AplikatorService proxyObject = rtarget.proxy(AplikatorService.class);
		/**
		 * Proxy object call
		 * proxyObject.getApplication()
		 * .....
		 */
	
	}
}
